{template header common}

<style>
html, body, .myBalance-wrapper {
	width: 100%;
	height: 100%;
	background: #f4f3f3;
}

.balance-back {
	width: 100%;
	height: 130px;
	background-color: #97c619;
	color: #fff;
	padding-left: 50px;
}

.balance-back .text {
	font-size: 12px;
	padding: 20px 0 15px 0; 
}

.balance-back .count {
	font-size: 30px;
	line-height: 0.75;
	padding-bottom: 18px;
}

.pay-items-box {
	width: 100%;
	padding: 0 10px;
	margin-top: -40px;
}

.pay-items-box li {
	width: 100%;
	border-bottom: 1px solid #ddd;
	background-color: #fff;
	padding: 14px 15px;
}

.pay-items {
	position: relative;
}

.pay-items h1 {
	font-size: 18px;
	color: #97c619;
}

.pay-items h2 {
	font-size: 15px;
	color: #444;
	padding-bottom:5px;
}

.pay-items p {
	font-size: 13px;
	color: #999;
}

.pay-items .pay-count {
	position: absolute;
	right: 15px;
	top: 23px;
	font-size: 20px;
}

.pay-items .pay-in {
	color: #ff9656;
}

.pay-items .pay-out {
	color: #97c619;
}

.pay-items-box li:nth-child(1) {
	padding: 21px 15px;
	line-height: 1;
}


.normal-btn {
	position: fixed;
	left: 50%;
	margin-left: -140px;
	bottom: 90px;
	width: 280px;
	height: 30px;
	line-height: 30px;
	color: #fff;
	font-size: 18px;
	background-color: #97c619;
	text-align: center;
	border-radius: 15px;
}

.lookmore{
	width: 100%;
	position: fixed;
	bottom: 125px;
	text-align: center;
}

.lookmore a{
	font-size: 16px;
	color: #ffae2e;
}
.mui-pull-bottom-pocket{ display:none;}
.mui-pull-top-pocket{ display:none;}
</style>

<script type="text/javascript" src="{SKIN_PATH}statics/log/js/mui.min.js?v={HD_VERSION}"></script>
<script>
	
	var page = "<?php echo $_GET['page']?>";
	var url = "<?php echo url('member/money/get_log')?>";
	function add_more(){
		var param = {
			"limit" : 4,
			"page" : page
		}
		
		$("#add_more").text('数据加载中...');
		pull_get_lists(param,url,'up');
	}
	
	function pull_get_lists(param,url,type){
		$.post(url,param,function(ret){
			var html = '';
			if(ret && ret.length > 0){
				$.each(ret,function(i,v){
					var logT = "支付";
					if(v.ltype == 0){
						logT = "支付";
					}else if(v.ltype == 1){
						logT = "退款";
					}else if(v.ltype == 2){
						logT = "提现";
					}else if(v.ltype == 3){
						logT = "奖励券";
					}else if(v.ltype == 4){
						logT = "提现清券";
					}else if(v.ltype == 5){
						logT = "平台奖励";
					}
					html += '<li class="pay-items"><h2>'+logT+'<font style=" font-size:12px; color:#999;  font-weight:normal;padding-left:3px;">('+v.msg+')</font></h2><p>'+v.dateline_text+'</p>'
					if(v.ltype == 0 || v.ltype == 2 || v.ltype == 4){
						html += '<div class="pay-count pay-out">'+v.value+'</div></li>'
					}else{
						html += '<div class="pay-count pay-in">+'+v.value+'</div></li>'
					}
				});
				if(type == 'up'){
					$(".log-lists").append(html);
					$(".order-lists").hide();
					page = page*1 + 1;
				}else{
					$('.log-lists').html(html);
					$(".order-lists").hide();
					page = 2;					
				}
				$("#add_more").text('查看更多');
			}else{
				if(page == 1){
					$(".log-lists").hide();
					$(".order-lists").show();
				}
				$("#add_more").text('没有更多数据');
			}
		},'json');
	}
	$(function(){
		add_more();
	})
</script>

<div class="myBalance-wrapper" >
	<div class="balance-back">
		<p class="text">余额 （元）</p>
		<p class="count">{$member['money']}</p>
	</div>
	
	<ul class="pay-items-box">
		<li class="pay-items"><h1>交易明细</h1></li>
	</ul>
	
	<ul class="pay-items-box log-lists" style="margin-top:0;">
		
	</ul>
	<ul class="pay-items-box order-lists" style="margin-top:0;">
		<li class="pay-items" style="text-align:center;">
			<img src="{SKIN_PATH}statics/images/bg_1.png" style=" display:inline;"/>
			<p class="margin-top text-black hd-h5">您还没有相关的记录</p>
		</li>
	</ul>
    <div class="lookmore" style="position:inherit; margin:10px 0;"><a href="javascript:;" id="add_more" onclick="add_more()">查看更多</a></div>
</div>
	

{template footer common}
